String-Processing Functions and Statements Getting part of a string ------------------------ LEFT$ Returns given number of characters from the left side of a string. RIGHT$ Returns given number of characters from the right side of a string. LTRIM$ Returns a copy of a string with leading spaces stripped away. RTRIM$ Returns a copy of a string with trailing spaces stripped away. MID$ function Returns given number of characters from anywhere in a string. Calculating available memory space ---------------------------------- FRE(a$) For far strings, returns the space remaining in a$'s segment. For near strings, compacts string storage space and returns space remaining in DGROUP. FRE(literal string) For far strings, returns the space remaining in the temporary string segment. For near strings, compacts string storage space and returns space remaining in DGROUP. FRE(number) Measures available storage for strings, nonstring arrays, or the stack. Searching strings ----------------- INSTR Searches for a string within another string. Converting to uppercase or lowercase letters -------------------------------------------- LCASE$ Returns a copy of a string with all uppercase letters (A-Z) converted to lowercase letters (a-z); leaves lowercase letters and other characters unchanged. UCASE$ Returns a copy of a string with all lowercase letters (a-z) converted to uppercase letters (A-Z); leaves uppercase letters and other characters unchanged. Changing strings ---------------- MID$ Statement Replaces part of a string with another string. LSET Left justifies a string within a fixed-length string. RSET Right justifies a string within a fixed-length string. Converting between numbers and strings -------------------------------------- STR$ Returns the string representation of the value of a numeric expression. VAL Returns the numeric value of a string expression. Creating strings of repeating characters ---------------------------------------- SPACE$ Returns a string of blank characters of a specified length. STRING$ Returns a string consisting of one repeated character. Getting the length of a string ------------------------------ LEN Tells how many characters are in a string. Working with ASCII values ------------------------- ASC Returns the ASCII value of the given character. CHR$ Returns the character with the given ASCII value. Creating string pointers ------------------------ SSEG Returns the segment of the string data. SADD Returns the offset of the string data. SSEGADD Returns a far pointer to the string data. VARPTR Returns the offset address of a variable or string descriptor. VARSEG Returns the segment address of a variable or string descriptor.